package br.com.quiz.domain;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.PrimaryKeyJoinColumn;

/**
 * The persistent class for the professor database table.
 * 
 */
@Entity
@PrimaryKeyJoinColumn(name = "PRO_PES_ID")
@NamedQueries(value = {
		@NamedQuery(name = "Professor.filtrarPorId", query = "Select professor From Professor professor where professor.proId = :proId"),
		@NamedQuery(name = "Professor.listar", query = "SELECT p FROM Professor p") })
public class Professor extends Pessoa implements Serializable {

	private static final long serialVersionUID = 1L;

//	@Id
	@Basic
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "PRO_ID")
	private int proId;

//	@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
//	@JoinTable(name = "disciplina_professor", joinColumns = @JoinColumn(name = "DIP_PRO_ID"), inverseJoinColumns = @JoinColumn(name = "DIP_DIS_ID"))
//	private List<Disciplina> disciplinas;

	// public < Disciplina > List< br.com.quiz.domain.Disciplina >
	// getDisciplinas() {
	// return disciplinas;
	// }
//	public List<Disciplina> getDisciplinas() {
//		return disciplinas;
//	}

//	public void setDisciplinas(List<Disciplina> disciplinas) {
//		this.disciplinas = disciplinas;
//	}

	public Professor() {
	}

	public int getProId() {
		return this.proId;
	}

	public void setProId(int proId) {
		this.proId = proId;
	}

	@Override
	public String toString() {
		return "Professor [proId=" + proId + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + proId;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Professor other = (Professor) obj;
		if (proId != other.proId)
			return false;
		return true;
	}
	
	
	
}